package megrez.job.custom.web.vo;

import org.springframework.beans.BeanUtils;

import lombok.Data;
import megrez.job.custom.domain.Config;

/**
 * 任务配置信息录入
 * 
 * @author Lucky Yang
 * @since 2.6.9
 */
@Data
public class ConfigInput {
    private String className;
    private String methodName;
    private String methodParams;
    private String cronExpression;
    private String remark;
    private Boolean enabled;

    public ConfigInput() {
    }

    public ConfigInput(String className, String methodName, String methodParams, String cronExpression,
            String remark, Boolean enabled) {
        this.className = className;
        this.methodName = methodName;
        this.methodParams = methodParams;
        this.cronExpression = cronExpression;
        this.remark = remark;
        this.enabled = enabled;
    }

    public Config copyTo(Config config) {
        BeanUtils.copyProperties(this, config);
        return config;
    }

    public static Config convert(ConfigInput input) {
        Config rslt = new Config();
        BeanUtils.copyProperties(input, rslt);
        return rslt;
    }
}
